{
 "metadata": {
  "name": "",
  "signature": "sha256:de74b465e3e6a48117fcdb0a3fd4259d1abcb22bd7792d4e1cd033d3e9022ee3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "slide"
      }
     },
     "source": [
      "##\u4e66\u5199javascript"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%javascript\n",
      "alert('hello world');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "javascript": [
        "alert('hello world');"
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.Javascript object>"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "!ps -a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "  PID TTY          TIME CMD\r\n",
        "  803 pts/16   00:00:00 python\r\n",
        "  959 pts/16   00:00:00 python\r\n",
        " 1028 pts/16   00:00:00 python\r\n",
        " 1422 pts/16   00:00:00 python\r\n",
        " 1438 pts/16   00:00:00 python\r\n",
        " 1452 pts/16   00:00:00 python\r\n",
        " 1615 pts/17   00:00:00 ps\r\n",
        "16486 tty1     00:00:00 zsh\r\n",
        "28524 pts/16   00:00:19 ipython\r\n",
        "29404 pts/0    00:02:12 gtermserver\r\n",
        "29728 pts/16   00:00:02 python\r\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%ruby\n",
      "puts 'hello'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "hello\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "##\u4e66\u5199html or markdown"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<table align=\"\" border=\"1\" bordercolor=\"#B7CBFF\">\n",
      "\t<tbody><tr>\n",
      "\t\t<td>Language</td>\n",
      "\t\t<td>C</td>\n",
      "\t\t<td>C++</td>\n",
      "\t\t<td>Pascal</td>\n",
      "\t</tr>\n",
      "\t<tr>\n",
      "\t\t<td>To read numbers</td>\n",
      "\t\t<td>int n;<br>\n",
      "\t\t\twhile(scanf(\"%d\", &amp;n) != EOF)<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>int n;<br>\n",
      "\t\t\twhile (cin &gt;&gt; n)<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>var n: integer;<br>\n",
      "\t\t\t...<br>\n",
      "\t\t\twhile not seekeof   do<br>\n",
      "\t\t\tbegin<br>\n",
      "\t\t\t\u3000\u3000read(n);<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\tend;<br>\n",
      "\t\t</td>\n",
      "    </tr>\n",
      "\t<tr>\n",
      "\t\t<td>To read characters</td>\n",
      "\t\t<td>int c;<br>\n",
      "\t\t\twhile ((c = getchar()) !=   EOF)<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>char c;<br>\n",
      "\t\t\twhile (cin.get(c))<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>var c: char;<br>\n",
      "\t\t\t...<br>\n",
      "\t\t\twhile not eof   do<br>\n",
      "\t\t\tbegin<br>\n",
      "\t\t\t\u3000\u3000read(c);\n",
      "\t\t\t<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\tend;<br>\n",
      "\t\t</td>\n",
      "    </tr>\n",
      "\t<tr>\n",
      "\t\t<td>To read lines</td>\n",
      "\t\t<td>char line[1024];<br>\n",
      "\t\t\twhile(gets(line))<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>string line;<br>\n",
      "\t\t\twhile (getline(cin, line))<br>\n",
      "\t\t\t{<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\t}<br>\n",
      "\t\t</td>\n",
      "\t\t<td>var line: string;<br>\n",
      "\t\t\t...<br>\n",
      "\t\t\twhile not eof do<br>\n",
      "\t\t\tbegin<br>\n",
      "\t\t\t\u3000\u3000readln(line);<br>\n",
      "\t\t\t\u3000\u3000...<br>\n",
      "\t\t\tend;<br>\n",
      "\t\t</td>\n",
      "    </tr>\n",
      "</tbody></table>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "##\u663e\u793a\u6570\u5b66\u516c\u5f0f"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%latex\n",
      "\\[x_{1,2}=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}\\]\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "latex": [
        "\\[x_{1,2}=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}\\]"
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.Latex object>"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "##\u6d1b\u4ed1\u5179\u5750\u6807\u53d8\u6362\u516c\u5f0f"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%latex\n",
      "\\[ \\left\\{ \\begin{array}{l} x = \\frac{x'+vt'}{\\sqrt{1-\\left(\\frac{v}{c}\\right)^2}} \\\\ y = y' \\\\ z = z' \\\\ t = \\frac{t'+\\frac{v}{c^2}x'}{\\sqrt{1-\\left(\\frac{v}{c}\\right)^2}} \\end{array} \\right. \\]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "latex": [
        "\\[ \\left\\{ \\begin{array}{l} x = \\frac{x'+vt'}{\\sqrt{1-\\left(\\frac{v}{c}\\right)^2}} \\\\ y = y' \\\\ z = z' \\\\ t = \\frac{t'+\\frac{v}{c^2}x'}{\\sqrt{1-\\left(\\frac{v}{c}\\right)^2}} \\end{array} \\right. \\]"
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.Latex object>"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "##\u4e00\u5143\u4e09\u6b21\u65b9\u7a0b\\(ax^3+bx^2+cx+d=0(a\u22600)\\)\u7684\u89e3\u662f\uff1a"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "%%latex\n",
      "\\begin{align*} x_1 = &-\\frac{b}{3 a}\\\\ &-\\frac{1}{3 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &-\\frac{1}{3 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ x_2 = &-\\frac{b}{3 a}\\\\ &+\\frac{1+i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &+\\frac{1-i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ x_3 = &-\\frac{b}{3 a}\\\\ &+\\frac{1-i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &+\\frac{1+i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]} \\end{align*}\n",
      "\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "latex": [
        "\\begin{align*} x_1 = &-\\frac{b}{3 a}\\\\ &-\\frac{1}{3 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &-\\frac{1}{3 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ x_2 = &-\\frac{b}{3 a}\\\\ &+\\frac{1+i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &+\\frac{1-i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ x_3 = &-\\frac{b}{3 a}\\\\ &+\\frac{1-i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d+\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]}\\\\ &+\\frac{1+i \\sqrt{3}}{6 a} \\sqrt[3]{\\frac12\\left[2 b^3-9 a b c+27 a^2 d-\\sqrt{\\left(2 b^3-9 a b c+27 a^2 d\\right)^2-4 \\left(b^2-3 a c\\right)^3}\\right]} \\end{align*}\n",
        "\n",
        " "
       ],
       "metadata": {},
       "output_type": "display_data",
       "text": [
        "<IPython.core.display.Latex object>"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}